package com.application.util;

import com.application.domain.User;
import com.application.dto.UserDTO;

// 这个就是用来 存储  当前登录用户的基本信息
public class UserHolder {
    private static final ThreadLocal<UserDTO> tl = new ThreadLocal<>();

    public static void setUser(UserDTO userDTO){
        tl.set(userDTO);
    }

    public static UserDTO getUser(){
        return tl.get();
    }

    public static void removeUser(){
        tl.remove();
    }
}
